﻿using CityDashboard.Models;
using System;
using System.Collections.Generic;
using System.Text;
using Windows.UI;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

namespace CityDashboard.Converters
{
    public class HoSoChiTietToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            
            HoSoChiTiet result = value as HoSoChiTiet;
            if (result == null)
                return null;
            if (result.LoaiHs == 0)
            {
                return new SolidColorBrush(Color.FromArgb(255, 158, 28, 31));
            }
            else
            {
                return new SolidColorBrush(Color.FromArgb(255, 134, 196, 93));
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
